const { Router } = require('express')
const router = new Router()

// 引入用户信息表
const UserInformation = require('../../model/userImformation')

router.get('/showAddress',function (request, response) {
    const { _id } = request.query
    UserInformation.find({
        _id
    },{
        _id: 0,
        'addressArr.hostId': 0,
        'addressArr.createTime': 0,
        'addressArr.createTimeX': 0
    },function (err,doc) {
        const data = {
            code: '200'
        }
        if (err){
            data.data = 'error'
            data.msg = '查询用户地址信息失败'
            console.log(err)
        } else {
            data.msg = 'success'
            data.data = doc[0].addressArr
        }
        return response.json(data)
    })
})

module.exports = router
